from django.shortcuts import render

# Create your views here.
from .ser import *
from rest_framework.views import APIView
from rest_framework.response import Response
class TeacherAPIView(APIView):
    def post(self,request):
        data = request.data
        ser = TeacherSer(data=data)
        if ser.is_valid():
            return Response({'code':200})
        else:
            print(ser.errors)
            return Response({"code":20010})
class TeacherView(APIView):
    def post(self,request):
        username = request.data.get('username')
        password = request.data.get('password')
        ser = Teacher.objects.filter(username=username).first()
        if username== ser.username:
            if password == ser.password:
                return Response()
    def get(self,request):
        data = request.data.get('data')
        ser =